package net.siufung.security.base.exception.catetory;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import net.siufung.core.result.ResultFail;
import net.siufung.security.base.exception.Oauth2Exception;
import net.siufung.security.base.exception.Oauth2ExceptionSerializer;
import net.siufung.security.base.exception.enums.Oauth2ErrorCodes;

/**
 * @author 陈建峰
 * @since 2022/3/2 1:38 下午
 */
@JsonSerialize(using = Oauth2ExceptionSerializer.class)
public class InvalidUnknownException extends Oauth2Exception {

	private static final long serialVersionUID = -606390382649067345L;

	public InvalidUnknownException() {
		super(ResultFail.AUTH_INVALID_UNKNOWN.getMessage());
	}

	public InvalidUnknownException(String msg) {
		super(msg);
	}

	public InvalidUnknownException(String msg, Throwable t) {
		super(msg);
	}

	@Override
	public String getOAuth2ErrorCode() {
		return Oauth2ErrorCodes.INVALID_UNKNOWN.getMessage();
	}

	@Override
	public int getHttpErrorCode() {
		return Oauth2ErrorCodes.INVALID_UNKNOWN.getCode();
	}
	
}
